function AnimateGroundTrack(t,R,UTC,dt)
    
    tnew = 0:dt:ceil(max(t ...
        ));
    %[s]New time vector.
    
    Rnew = [interp1(t,R(1,:),tnew); ...
            interp1(t,R(2,:),tnew); ...
            interp1(t,R(3,:),tnew)];
    %[km]New position matrix.
    
    JD = juliandate(UTC) + tnew / 3600 / 24;
    %[solar days]Julian date vector.
    
    Tu = juliandate(UTC) - 2451545 + tnew / 3600 / 24;
    %[solar days]Solar days between the initial universal time and January 1, 2000 at noon.
    
    ERA = 2 * pi * (0.7790572732640 + 1.00273781191135448 * Tu);
    %[deg]Earth rotation angles for all simulation times.
    
    n = numel(tnew);
    %[]Number of satellite positions that are being plotted.
    
    latitude = zeros(1,n);
    %[]Allocates memory for the satellite latitudes during the simulation time.
    
    longitude = zeros(1,n);
    %[]Allocates memory for the satellite longitudes during the simulation time.
    
    for k = 1:n;
        
        EciToEcef = [cos(ERA(k)), sin(ERA(k)), 0; -sin(ERA(k)), cos(ERA(k)), 0; 0, 0, 1];
        %[]Current matrix that transforms vectors from ECI coordinates to ECEF coordinates.
        
        Recef = EciToEcef * Rnew(:,k);
        %[km]Current satellite position WRT the Earth in ECEF coordinates.
        
        latitude(k) = asin(Recef(3) / norm(Recef)) * 180 / pi;
        %[deg]Current satellite latitude.
        
        longitude(k) = atan2(Recef(2),Recef(1)) * 180 / pi;
        %[deg]Current satellite longitude.
        
    end
    
    Window = figure;
    %[]Opens a new window.
    
    Axes = axes('Parent',Window);
    %[]Adds an axes to the specified window.
    
    Earth = imread('Earth.bmp');
    %[]Loads the groundtrack image data.
    
    GroundTrack = image(Earth);
    %[]Adds a plot to the current axes.
    
    ScreenSize = get(0,'ScreenSize');
    %[]Determines the location and dimensions of the current monitor.
    
    set(GroundTrack, ...
        'XData',[-180,180], ...
        'YData',[-90,90]);
    %[]Adjusts the properties of the groundtrack image.
    
    set(Window, ...
        'Color','k',...
        'MenuBar','None', ...
        'NumberTitle','Off', ...
        'Name','GROUND TRACK', ...
        'OuterPosition',ScreenSize, ...
        'Resize','Off', ...
        'ToolBar','None');
    %[]Adjusts the properties of the specified window.
    
    Longitude = {'180W','165W','150W','135W','120W','105W','90W','75W','60W','45W','30W','15W', ...
        '0','15E','30E','45E','60E','75E','90E','105E','120E','135E','150E','165E','180E'};
    %[]Longitude string.
    
    Latitude = {'90N','75N','60N','45N','30N','15N','0','15S','30S','45S','60S','75S','90S'};
    %[]Latitude string.
    
    set(Axes, ...
        'FontName','Arial', ...
        'FontSize',10, ...
        'FontWeight','Bold', ...
        'NextPlot','Add', ...
        'XColor','y', ...
        'YColor','y', ...
        'XGrid','On', ...
        'YGrid','On', ...
        'XLim',[-180,180], ...
        'YLim',[-90,90], ...
        'XTick',-180:15:180, ...
        'YTick',-90:15:90, ...
        'XTickLabel',Longitude, ...
        'YTickLabel',Latitude);
    %[]Adjusts the properties of the specified axis.
    
    xlabel('Longitude (\circ)','FontSize',16,'Parent',Axes);
    %[]Adds a label to the specified x-axis and adjusts its properties.
    
    ylabel('Latitude (\circ)','FontSize',16,'Parent',Axes);
    %[]Adds a label to the specified y-axis and adjusts its properties.
    
    Text = text( ...
        'BackGroundColor','k', ...
        'Color','y', ...
        'EdgeColor','r', ...
        'FontName','Arial', ...
        'FontSize',12, ...
        'FontWeight','Bold', ...
        'LineStyle','-', ...
        'LineWidth',3, ...
        'Parent',Axes, ...
        'Position',[-175,80], ...
        'String','Test');
    %[]Adds a text box to the specified axes and adjusts its properties.
    
    for k = 1:n;
        
        plot(longitude(k),-latitude(k), ...
            'Color','r', ...
            'LineStyle','None', ...
            'Marker','.', ...
            'MarkerSize',15, ...
            'Parent',Axes);
        %[]Plots the satellite ground track.
        
        phi = abs(degrees2dms(latitude(k)));
        %[degrees,minutes,seconds]Converts the current latitude from DD to DMS.
        
        String1 = ['\phi = ', ...
            num2str(phi(1),'%03.0f'), ...
            '\circ ', ...
            num2str(phi(2),'%02.0f'), ...
            ''' ', ...
            num2str(phi(3),'%02.0f'), ...
            '" '];
        %[]Textbox latitude string.
        
        if latitude(k) >= 0;
            
            String1 = [String1,'N'];
            %[]Updated textbox latitude string.
            
        else
            
            String1 = [String1,'S'];
            %[]Updated textbox latitude string.
            
        end
        
        lambda = abs(degrees2dms(longitude(k)));
        %[degrees,minutes,seconds]Converts the current latitude from DD to DMS.
        
        String2 = ['\lambda = ', ...
            num2str(lambda(1),'%03.0f'), ...
            '\circ ', ...
            num2str(lambda(2),'%02.0f'), ...
            ''' ', ...
            num2str(lambda(3),'%02.0f'), ...
            '" '];
        %[]Textbox longitude string.
        
        if longitude(k) >= 0;
            
            String2 = [String2,'E'];
            %[]Updated textbox longitude string.
            
        else
            
            String2 = [String2,'W'];
            %[]Updated textbox longitude string.
            
        end
        
        CD = CalendarDate(JD(k));
        %[year,month,day,hour,minute,second]Current calendar date.
        
        String3 = sprintf('Julian Date = %0.8f',JD(k));
        %[]z-displacement string.
        
        String4 = sprintf('Calendar Date = %4.0f:%02.0f:%02.0f:%02.0f:%02.0f:%02.0f',CD);
        %[]Calendar date string.
        
        String = char(String1,String2,String3,String4);
        %[]Textbox string.
        
        set(Text,'String',String);
        %[]Updates thet textbox string.
        
        pause(0.001);
        %[s]Pauses the loop for the specified amount of time.
        
    end
    
    title('Simulation Complete!','Color','y','FontSize',20,'Parent',Axes);
    %[]Adds a title to the specified axes and adjusts its properties.
    
end
%===================================================================================================